package com.example.oj;

import lombok.Data;

import java.io.FileNotFoundException;
import java.io.PrintStream;

/**
 * @author zjianfa
 */
@Data
public class PrintOut {
    private PrintStream print;

    public PrintOut(String path){
        try {
            print=new PrintStream(path);
            System.setOut(print);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public void close(){
        if (print==null){
            return;
        }
        print.close();
    }
}
